﻿#region Copyright information
// 
// Copyright © 2012-2013 Yongkee Cho. All rights reserved.
// 
// This code is a part of the SubnetworkToolkit and governed under the terms of the
// GNU Lesser General  Public License (LGPL) version 2.1 which accompanies this distribution.
// For more information on the LGPL, please visit http://bol.codeplex.com/license.
// 
// - Filename: Options.cs
// - Author: Yongkee Cho
// - Email: yongkeecho@outlook.com
// - Date Created: 2013-01-30 2:55 PM
// - Last Modified: 2013-01-30 3:21 PM
// 
#endregion
using System.Collections.Generic;
using System.Text;
using CommandLine;

namespace SubnetworkToolkit.GreedySearch
{
    public class Options
    {
        [Option("e", "degree", DefaultValue = 3, HelpText = "Specify a degree.")]
        public int Degree { get; set; }

        [Option("d", "depth", DefaultValue = 2, HelpText = "Specify a depth.")]
        public int Depth { get; set; }

        [Option("f", "fraction", DefaultValue = 1.0, HelpText = "Specify a fraction.")]
        public double Fraction { get; set; }

        [Option("n", "networkfile", HelpText = "Specify a network file.")]
        public string NetworkFile { get; set; }

        [Option("s", "statisticsfile", HelpText = "Specify an statistics file.")]
        public string StatisticsFile { get; set; }

        [Option("o", "outputFile", HelpText = "Specify the output file.")]
        public string OutputFile { get; set; }
        
        [Option("y", "threshold", HelpText = "Specify a threshold.")]
        public double Threshold { get; set; }

        [Option("t", "top", HelpText = "Sepecify how many subnetwork will be taken.")]
        public int Top { get; set; }

        [Option("v", "verbose", HelpText = "Sepecify if it prints out on screen.")]
        public int IsVerbose { get; set; }

        [OptionList("a", "bypass", DefaultValue = new string[0], Separator = ':', HelpText = "Sepecify ...")]
        public IList<string> Bypass { get; set; }

        [HelpOption(HelpText = "Dispaly this help screen.")]
        public string GetUsage()
        {
            var help = new StringBuilder();
            help.AppendLine("Usage(linux)   : mono ga.exe [OPTION]");
            help.AppendLine("Usage(windows) : ga [OPTION]");
            help.AppendLine("Options:");
            help.AppendLine("    -n           network file");
            help.AppendLine("    -s           statistics file");
            help.AppendLine("    -o           output file");
            help.AppendLine("    -d           depth");
            help.AppendLine("    -e           degree");
            help.AppendLine("    -f           fraction");
            help.AppendLine("    -y           threshold");
            help.AppendLine("    -t           top n to take");
            help.AppendLine("    -v           verbose mode");
            help.AppendLine();
            help.AppendLine("e.g. ga -n background1 -s statistics.txt -o greedy.gmt -d 2 -e 3 -f 0.5 -y 0.000000001 -t 100 -v 1");
            return help.ToString();
        }
    }
}
